
// ========== Token 相关 ==========
const tokenKey = 'auth-token';
export const getToken = () => {
	return uni.getStorageSync(tokenKey);
}

export const setToken = (val) => {
	return uni.setStorageSync(tokenKey, val);
}

export const removeToken = () => {
	return uni.removeStorageSync(tokenKey);
}

// ========== 账号相关 ==========

const UsernameKey = 'login-name';
const PasswordKey = 'password';
const CorpCodeKey = 'corp-code';

export function getUsername() {
	return uni.getStorageSync(UsernameKey);
}
export const setUsername = (val) => {
	return uni.setStorageSync(UsernameKey, val);
}
export const removeUsername = () => {
	return uni.removeStorageSync(UsernameKey);
}

// 密码
export function getPassword() {
	return uni.getStorageSync(PasswordKey);
}
export const setPassword = (val) => {
	return uni.setStorageSync(PasswordKey, val);
}
export const removePassword = () => {
	return uni.removeStorageSync(PasswordKey);
}

// 公司码
export function getCorpCode() {
	return uni.getStorageSync(CorpCodeKey);
}
export const setCorpCode = (val) => {
	return uni.setStorageSync(CorpCodeKey, val);
}
export const removeCorpCode = () => {
	return uni.removeStorageSync(CorpCodeKey);
}

// openId
const OPENIDKEY = 'openId';
export function getOpenId() {
	return uni.getStorageSync(OPENIDKEY);
}
export const setOpenId = (val) => {
	return uni.setStorageSync(OPENIDKEY, val);
}
export const removeOpenId = () => {
	return uni.removeStorageSync(OPENIDKEY);
}
